package com.kinyx.demo.entities.impl1;

import javax.persistence.Column;
import javax.persistence.Entity;

import com.kinyx.framework.annotation.RandomExpression;
import com.kinyx.framework.db.annotation.Comment;
import com.kinyx.framework.db.entities.MappedSuperclassBase;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@Entity
@Comment("用户表")
@ToString
public class DemoSysUserEntity extends MappedSuperclassBase {

	@Column(nullable = false, unique = true, length = 64)
	@Comment("身份证号（加密）")
	@RandomExpression("KRandomUtils.randomString(false, KRandomUtils.random(64, 64), RandomRange.NUMBER_AND_LETTER_FULL)")
	private String userCard;

	@Column(nullable = false, length = 32)
	@Comment("姓名")
	@RandomExpression("KRandomUtils.randomString(false, KRandomUtils.random(3, 16), RandomRange.LETTER_FULL)")
	private String userName;

	@Column(length = 10)
	@Comment("生日（yyyy-MM-dd）")
	@RandomExpression("KRandomUtils.randomBoolean(false) ? null : (KRandomUtils.random(1986, 2018) + \"-\" + KStringUtils.fillZero(KRandomUtils.random(1, 12), 2) + \"-\" + KStringUtils.fillZero(KRandomUtils.random(1, 28), 2))")
	private String birthday;

	@Column(nullable = false, length = 11)
	@Comment("手机号码")
	@RandomExpression("KRandomUtils.random(13000000000L, 19999999999L)")
	private String cellphone;

	@Column(length = 64)
	@Comment("邮箱")
	@RandomExpression("KRandomUtils.randomBoolean(false) ? null : (KRandomUtils.randomString(false, KRandomUtils.random(3, 16), RandomRange.LETTER_FULL) + \"@\" + KRandomUtils.randomString(false, KRandomUtils.random(3, 16), RandomRange.NUMBER_AND_LETTER_FULL) + \".com\")")
	private String email;

}
